package fun.lifepoem.event.service;

import fun.lifepoem.event.event.NewRegisterEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class TestService  {


    @Resource
    private TService tService;

    @Resource
    private ApplicationEventPublisher applicationEventPublisher;


    public String register() {

        System.out.println("执行注册");

        String result = "成功";

        applicationEventPublisher.publishEvent(new NewRegisterEvent(this, result));

        return result;

    }

    public void test() {
        tService.tHaha();
    }

}
